A smart card can be inserted into an electronic device for communicating with the electronic device, to write and read data. Examples of smart cards can include contact smart cards such as SIM cards. However, when the smart card is detached or removed from the electronic device, the data stored in the smart card can become corrupted.